package com.qingniao.hb.service.impl;

import com.qingniao.hb.dao.UserDao;
import com.qingniao.hb.dao.impl.UserDaoImpl;
import com.qingniao.hb.entity.User;
import com.qingniao.hb.service.UserService;

import java.sql.SQLException;

/**
 * @author xlzhang
 * @date 2023/4/13 14:29
 */
public class UserServiceImpl implements UserService {
    /**
     * 用户的数据访问对象
     */
    private final UserDao userDao = new UserDaoImpl();

    @Override
    public User login(String username) {
        try {
            return userDao.selectByUsername(username);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
